package com.ccloud.blog.modules.blog.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ccloud.blog.modules.blog.domain.Blog;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author chentailai
 * @since 2019-09-05
 */
public interface BlogMapper extends BaseMapper<Blog> {
    /**
     * 获取博客列表
     *
     * @return
     */
    List<Map<String, Object>> getBlogList(@Param("page") Page<Map<String, Object>> page, @Param("blog") Blog blog, @Param("order") String order);


    /**
     * @return java.util.List
     * @author chentl
     * @description 根据 blogTypeId 获取博客
     * @date 2019/9/16 16:04
     * @params [blogTypeId]
     * @since JDK 1.7
     */
    List<Map<String, Object>> getBlogsByBlogTypeId(@Param("blogType") Integer blogType);

    /**
     * 根据blogType 查询 blogId 不等于当前的相关博客，根据id倒叙取10条；
     *
     * @param blog
     * @return
     */
    List<Map<String, Object>> getRecommendedArticle(@Param("blog") Blog blog);
}
